{template '_header'}
<style>
    .page-cashier-register .regbg {
        width:100%;
    }
    .page-cashier-register .fui-navbar {
        background:rgba(0,0,0,0)
    }
    .page-cashier-register .fui-navbar:before {
        display:none;
    }
    .page-cashier-register .fui-navbar .btn {
        border:none;
    }
    .page-cashier-register .fui-navbar .btn-reg {
        width:10%; background:rgba(0,0,0,0.5);
    }
    .fui-modal,
    .verify-pop {
        position: fixed;
    }

    .verify-pop .qrcode {
        width: 250px;
        margin-left: -125px;
        border-radius: 0.5rem;
        height: auto;
        overflow: hidden;
    }

    .verify-pop.pop .qrcode {
        width: 70%;
        height: 15rem;
        margin-left: -35%;
        overflow: hidden;
        display: block;
    }

    .verify-pop.pop .qrcode .inner {
        padding: 0.5rem;
        height: 12rem;
    }

    .verify-pop.pop .qrcode .inner .title {
        text-align: center;
        font-size: 1rem;
        height: 1.5rem;
    }

    .verify-pop.pop .qrcode .inner .text {
        width: 100%;
        word-wrap: break-word;
        font-size: 0.7rem;
        color: #666;
        line-height: 1rem;
        height: 10rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .verify-pop.pop .qrcode .inner .text img {
        max-width: 100%;
    }
</style>
<div class="fui-page page-cashier-register">
    <div class="fui-content">

        <img class="regbg" src="{if empty($set['regbg'])}../addons/ewei_shopv2/plugin/cashier/template/mobile/default/static/images/regbg.png{else}{php echo tomedia($set['regbg'])}{/if}"/>

        {if !empty($user)}

            {if $user['status']==-1}

            <div class="fui-alert fui-alert-danger">
                <p>您的申请被驳回：</p>
                <p>{$reason}</p>
                <p>您也可以修改信息重新提交</p>
            </div>

            {else}
            <div class="fui-alert fui-alert-warning">
                <p>您已经提交了信息，请等待我们联系您!</p>
                <p>您也可以修改信息重新提交</p>
            </div>
            {/if}
        {/if}
        <form id="cashierForm">
        <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">收银台名称</div>
                <div class="fui-cell-info"><input type="text" name="title" class="fui-input" id="title" placeholder="收银台名称" value="{$user['title']}"/></div>
            </div>
            <div class="fui-cell ">
                <div class="fui-cell-label">收银台地址</div>
                <div class="fui-cell-info"><textarea name="address" id="address">{$user['address']}</textarea></div>
            </div>

        </div>
        <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">联系人</div>
                <div class="fui-cell-info"><input type="text" name="name" class="fui-input" id="name" placeholder="您的称呼" value="{$user['name']}"></div>
            </div>

            <div class="fui-cell must ">
                <div class="fui-cell-label">手机号</div>
                <div class="fui-cell-info"><input type="tel" name="mobile" class="fui-input" id="mobile" placeholder="您的手机号" value="{$user['mobile']}"/></div>
            </div>
            <div class="fui-cell-tip">请仔细填写联系方式，保证我们能尽快联系到您~</div>
            <input type="hidden" name="idcard1" value="{$user['idcard1']}">
            <div class='fui-cell'>
                <div class='fui-cell-label'>身份证正面</div>
                <div class='fui-cell-info'>
                    <ul class="fui-images fui-images-sm"></ul>
                    <div class="fui-uploader fui-uploader-sm" data-max="1" data-count="1" data-name="idcard1">
                        <input type="file" id='fileName1' name="fileName1" multiple="" accept="image/jpg,image/jpeg,image/png,image/gif" >
                    </div>
                </div>
            </div>

            <input type="hidden" name="idcard2" value="{$user['idcard2']}">
            <div class='fui-cell'>
                <div class='fui-cell-label'>身份证背面</div>
                <div class='fui-cell-info'>
                    <ul class="fui-images fui-images-sm"></ul>
                    <div class="fui-uploader fui-uploader-sm" data-max="1" data-count="1" data-name="idcard2">
                        <input type="file" id='fileName2' name="fileName2" multiple="" accept="image/jpg,image/jpeg,image/png,image/gif" >
                    </div>
                </div>
            </div>


        </div>

        <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">登录用户名</div>
                <div class="fui-cell-info"><input type="text" name="username" class="fui-input" id="username" placeholder="后台登录用户名" value="{$user['username']}"></div>
            </div>

            <div class="fui-cell must ">
                <div class="fui-cell-label">登录密码</div>
                <div class="fui-cell-info"><input type="password" name="password" class="fui-input" id="password" placeholder="如果已经填写过,留空为不更改" value=""/></div>
            </div>
            <div class="fui-cell-tip">请仔细填写联系方式，保证我们能尽快联系到您~</div>

        </div>

            <div class="fui-cell-group">
                <div class="fui-cell ">
                    <div class="fui-cell-label">推荐人</div>
                    <div class="fui-cell-info"><input type="text" name="referrer" class="fui-input" id="referrer" placeholder="后台登录用户名" value="{$user['referrer']}"></div>
                </div>

                <div class="fui-cell ">
                    <div class="fui-cell-label">推荐人手机</div>
                    <div class="fui-cell-info"><input type="tel" name="referrermobile" class="fui-input" id="referrermobile" placeholder="后台登录密码" value="{$user['referrermobile']}"/></div>
                </div>
                <div class="fui-cell-tip">请仔细填写联系方式，保证我们能尽快联系到您~</div>

            </div>

                {if $template_flag}

                {template 'diyform/formfields'}

                {/if}


                {if intval($set['applycontent']) == 1}
                <div class="fui-cell-group">
                    <div class="fui-cell small ">
                        <div class="fui-cell-info">

                            <label class="checkbox-inline">
                                <input type="checkbox" class="fui-checkbox-primary" id="agree" {if !empty($user)}checked{/if}/> 我已经阅读并了解了<a id="btn-apply" style="color:#337ab7;">【申请协议】</a>。
                            </label>

                        </div>
                    </div>

                </div>
                {/if}

        </form>
            {if $user['status']==1}
                <a class="btn btn-default block disabled"> 已经审核通过</a>
            {else}
                <a class="btn btn-warning btn-submit block"> {if empty($user)}立即申请入驻{else}重新提交申请{/if}</a>
            {/if}
        <div class="pop-apply-hidden" style="display: none;">
            <div class="verify-pop pop">
                <div class="close"><i class="icon icon-roundclose"></i></div>
                <div class="qrcode">
                    <div class="inner">
                        <div class="title">{$set['applytitle']}</div>
                        <div class="text">{$set['applycontent']}</div>
                    </div>
                    <div class="inner-btn" style="padding: 0.5rem">
                        <div class="btn btn-warning" style="width: 100%; margin: 0">我已阅读</div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <script language="javascript">
        require(['../addons/ewei_shopv2/plugin/cashier/static/js/register.js'], function (modal) {
            modal.init({applycontent:{php echo intval($set['applycontent'])}});
        })
    </script>
</div>
{template '_footer'}
